package com.bite.demo.dao;

import com.bite.demo.model.BookInfo;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Repository
public class BookDao {
    public List<BookInfo> mockData() {
        List<BookInfo> book = new ArrayList<>();
        for (int i = 0; i < 15; i++) {
            BookInfo bookInfo = new BookInfo();
            bookInfo.setId(i);
            bookInfo.setAuthor("作者"+i);
            bookInfo.setBookName("书"+i);
            bookInfo.setCount(i);
            bookInfo.setPrice(BigDecimal.valueOf(15*i));
            bookInfo.setPublish("出版社"+i);
            bookInfo.setStatus(i%5==0?1:2);
            book.add(bookInfo);

        }
        return book;
    }
}
